package com.party.core.dao.read.commune;

import com.party.common.annotation.DataAuthParam;
import com.party.common.paging.Page;
import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.commune.CIntegralItem;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @program: party
 * @description: 积分项数据读取接口
 * @author: Hua Qunhao
 * @create: 2019-08-12 14:15
 **/
@Repository
public interface CIntegralItemReadDao extends BaseReadDao<CIntegralItem> {

    /**
     * @param partnerId
     * @return
     * @Author hzq
     * @Description //根据pmid找到积分列表
     * @Date 15:33 2019/8/13
     **/
    List<CIntegralItem> getCIntegralItemsByPmIdAndTypeId(@Param("partnerId") String partnerId,
                                                         @Param("typeId") String typeId,
                                                         @Param("memberId") String memberId,
                                                         Page page);

    @DataAuthParam(moduleType="MEMBERMGMT" ,field="create_by",alias="cii")
    List<CIntegralItem> webPageList(@Param("params") Map<String, Object> params, Page page);

    Integer getItemNum(CIntegralItem cIntegralItem);

    /***
    * 查询个人所有积分列表
    * @Date 10:59 2019/10/16
    * @param partnerId
    * @return
    **/
    List<CIntegralItem> getCIntegralItemsByPmId(@Param("partnerId")String partnerId, @Param(value = "memberId") String memberId);

    List<CIntegralItem> getItemsByNameAndCategory(@Param("params") Map<String, Object> params);
}